<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
    <div onclick="commonJsToNative('local','jump_mobile_browser?link=https%3A%2F%2Fwww.baidu.com%2F')">哈哈</div>
</body>
<script type="text/javascript">
    /**
     * 通用跳转
     * @param target
     * @param link
     */
    function commonJsToNative(target, link) {
        if (!target)
            return;

        switch (app_type) {
            case 'ios':
                window.webkit.messageHandlers.commonJsToNative.postMessage({
                    'target': target,
                    'link': link
                });
                break;
            case 'android':
                console.log('android')
                androidwebview.commonJsToNative(target, link)
                break;
            default:
                console.log('not ios or android')
                if ('link' == target) {
                    window.location.href = link
                }
        }
    }
</script>
</html>
